home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
sos3-2.lha
/
src
/
cfe
/
cfe_main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-23
|
2KB
|
66 lines
/* --------------------------------------------------------------------------
* Copyright 1992 by Forschungszentrum Informatik (FZI)
*
* You can use and distribute this software under the terms of the licence
* you should have received along with this program.
* If not or if you want additional information, write to
* Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
* D-7500 Karlsruhe 1, Germany.
* --------------------------------------------------------------------------
*/
// **************************************************************************
// Module cfe_main Juergen Uhl (ju)
//
// **************************************************************************
#include <stdio.h>
#include <osfcn.h>
#include "sys.h"
#include "sos.h"
#include "cfe_err.h"
#include "trc_cfe.h"
#include "mta_use.h"
#include "cfe_yacc.h"
#include "cfe.h"
#ifdef PROFILE
extern "C" void monitor(...);
#endif
int main (int argc, char *argv[])
{ int status = 0;
T_INIT ("cfe.out");
sos_init (argc, argv);
if (argc == 3 AND streql (argv[1], "-E"))
cfe_echo_flag = 1;
else if (argc != 2)
{ err_raise (err_USE, err_CFE_USAGE, NULL, FALSE);
status = 1;
}
if (status EQ 0)
{
yyin = fopen (argv[argc-1], "r");
if (yyin == 0)
{ err_raise (err_USE, err_CFE_NO_FILE, argv[argc-1], FALSE);
status = 1;
}
else
{ cfe_compile ();
if (err_occurred (err_SYS) + err_occurred (err_USE) != 0)
status = -1;
}
}
#ifdef PROFILE
monitor (0);
#endif
T_EXIT ();
exit (status);
}